﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

namespace B2B.Models
{
    public class SP_DanhSachQG
    {
        int maQG;

        public int MaQG
        {
            get { return maQG; }
            set { maQG = value; }
        }
        string tenQG;

        public string TenQG
        {
            get { return tenQG; }
            set { tenQG = value; }
        }

        public static ArrayList ds_QuocGia()
        {
            SqlConnection conn = KetNoi.Connection();
            ArrayList lis_QG = new ArrayList();
            SqlCommand cmd = new SqlCommand("SP_DANHSACHQG", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();
            while (reader.Read())
            {
                SP_DanhSachQG qg = new SP_DanhSachQG();
                qg.MaQG = reader.GetInt32(0);
                qg.TenQG = reader.GetString(1);
                lis_QG.Add(qg);
            }
            return lis_QG;
        }

    }
}